package com.kl.lock.controller;

import com.kl.lock.service.RedisService;
import org.springframework.boot.SpringApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ShopApplication {

    private final RedisService redisService;

    public ShopApplication(RedisService redisService) {
        this.redisService = redisService;
    }

    public static void main(String[] args) {
        SpringApplication.run(ShopApplication.class, args);
    }

    @GetMapping("/buy")
    public String buy(String uid) {
        return redisService.buy(uid);
    }
}